package cn.ggsaas.base.enums;

import lombok.Getter;

/**
 * @author liyuzhen
 * date 2020-08-30
 */
@Getter
public enum ErrorEnum implements EEnum {
    /**
     * 系统错误码 (200-9999)
     */
    RIME_OUT(200, "超时"),

    /**
     * 业务相关代码 (10000-19999)
     */
    INVALID_REQUEST(10000, "不支持的请求方式"),

    /**
     * 用户相关 (20000-29999)
     */
    REQUEST_PARAM_ERROR(20000, "传入参数错误"),
    REGISTER_TYPE_ERROR(20001, "传入参数错误"),
    INVALID_SIGN(20002, "签名无效"),
    USER_LOGIN_EXIST(20003, "用户已存在"),
    USER_LOGIN_NOT_EXIST(20008, "用户不存在"),
    PASSWORD_ERROR(20009, "密码错误"),
    INVALID_LOGIN(20010, "登录失败,请重新登录"),
    INVALID_TOKEN(20011, "无效token"),
    NOT_TOKEN(20011, "token不存在"),
    USERNAME_ERROR(20012, "当前账户名格式不正确"),
    ;

    private final int code;
    private final String value;

    ErrorEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }
}
